<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="packtag" prefix="pack" %>
<c:set var="ctx" value="${pageContext.request.contextPath }"/>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>互助金服-企业团购</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

    <link href="${ctx}/static/pure/pure-min.css" rel="stylesheet" type="text/css"/>
    <link href="${ctx}/static/sweetalert/sweetalert.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="${ctx}/static/wx/wx.js"></script>
    <script type="text/javascript" src="${ctx}/static/jquery/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="${ctx}/static/validator/bootstrapValidator.min.js"></script>
    <script type="text/javascript" src="${ctx}/static/sweetalert/sweetalert.min.js"></script>
    <script type="text/javascript">

        wx.config(${config});

        wx.ready(function () {
            wx.onMenuShareAppMessage({
                title: '我正在申请“【租+】企业/员工租房福利计划”', // 分享标题
                desc: '【租+】企业/员工租房福利计划', // 分享描述
                link: '${shareUrl}', // 分享链接
                imgUrl: '${shareImgUrl}', // 分享图标
                type: 'link', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                },
                cancel: function () {
                }
            });
            wx.onMenuShareTimeline({
                title: '我正在申请“【租+】企业/员工租房福利计划”', // 分享标题
                link: '${shareUrl}', // 分享链接
                imgUrl: '${shareImgUrl}', // 分享图标
                success: function () {
                },
                cancel: function () {
                }
            });
            wx.hideMenuItems({
                menuList: ["menuItem:copyUrl"]
            });
        });

        $(function () {
            $("#submitBtn").on("click", submitHandler);

            $('form').bootstrapValidator({
                message:'格式不正确'
            });
        });

        //提交
        function submitHandler() {
            $("#submitBtn").attr("disabled", true);
            var $form = $("form");
            var validator = $form.data('bootstrapValidator').validate();
            if(!validator.isValid()){
                return;
            }
            $.post('/rent/rentApplyOrg/orgApply',
                    $form.serialize(),
                    function (data) {
                        if(data.resultCode == '1000'){
                            swal("保存成功");
                        }else{
                            swal(data.resultMsg);
                            $("#submitBtn").removeAttr("disabled");
                        }
                    });
        }
    </script>
    <style>
        .bg{
            background: url("${ctx}/static/img/other/bg.png") no-repeat;
            background-size: cover;
        }
        .zufang-block{
            margin: 26% 0 auto 1em;
        }
        .form-label{color: #994b00;font-weight: bolder;}
        .form-input{padding: 2% 4%;border: none;background-color: rgba(255,255,255,0.7);border-radius: 2px;color: #994b00;}
    </style>
</head>
<body lang="zh-CN" style="margin: 0 auto;" ontouchstart class="bg">
<div class="zufang-block">
    <%--<img class="pure-img" src="<c:url value="/static/img/other/bg.png"/>"/>--%>

    <form class="pure-form pure-form-stacked">
        <fieldset>
            <div class="pure-g" style="margin-right: 1em">
                <div class="form-label pure-u-1-4">
                    <label>企业名称</label>
                </div>
                <div class="pure-u-3-4">
                    <input class="form-input pure-input-1" name="name" type="text" placeholder="请输入企业名称">
                </div>
            </div>

            <div class="pure-g" style="margin-right: 1em">
                <div class="form-label pure-u-1-4">
                    <label>员工人数</label>
                </div>
                <div class="pure-u-3-4">
                    <input class="form-input pure-input-1" name="staffNum" type="text" placeholder="员工人数">
                </div>
            </div>
            <div class="pure-g" style="margin-right: 1em">
                <div class="form-label pure-u-1-4">
                    <label>联系人</label>
                </div>
                <div class="form-label pure-u-3-4">
                    <input class="form-input pure-input-1" name="contact" type="text" placeholder="请输入联系人">
                </div>
            </div>
            <div class="pure-g" style="margin-right: 1em">
                <div class="form-label pure-u-1-4">
                    <label>联系方式</label>
                </div>
                <div class="pure-u-3-4">
                    <input class="form-input pure-input-1" name="contactWay" type="text" placeholder="请输入联系方式">
                </div>
            </div>
            <div class="pure-g" style="margin-right: 1em">
                <div class="form-label pure-u-1-4">
                    <label>推荐单位</label>
                </div>
                <div class="pure-u-3-4">
                    <input class="form-input pure-input-1" name="referrer" type="text" placeholder="请输入推荐单位">
                </div>
            </div>

            <div  style="text-align: center;margin-right: 1em;margin-top: .3em">
                <button id="submitBtn" style="background-color: #994B00;color: #FFFFFF" class="pure-button pure-u-1-2">立即申请</button>
                <p style="margin: 0.1em 0;">（暂只支持厦门区域申请）</p>
            </div>
        </fieldset>
    </form>
</div>
<!-- Main END -->
</body>
</html>

